package task.main;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;

import com.timesheet.server.core.models.Employee;

public class Test {
	public static void main(String[] args) {
		Session session = new AnnotationConfiguration().configure()
				.buildSessionFactory().openSession();

		Transaction t = session.beginTransaction();

		Employee e1 = new Employee();
		e1.setEmployeeId("1003");
		e1.setName("sonoo");

		Employee e2 = new Employee();
		e2.setEmployeeId("1007");
		e2.setName("sonoo333");
		session.persist(e1);
		session.persist(e2);

		t.commit();
		session.close();
		System.out.println("successfully saved");
	}
}